Solving The Female Prisoner Problem